import request from "@/axios/request";
import url from "@/axios/url";
const { mesUrl, adminUrl } = url();
// 导出url
export const exportUrl = `${mesUrl}mesWorkCalendars/export`;
// 分页查询
export function getList (params = {}) {
  return request({
    url: `${mesUrl}mesWorkCalendars`,
    method: "get",
    params,
  });
}
// 新增
export function rowCreate (data = {}) {
  return request({
    url: `${mesUrl}mesWorkCalendars`,
    method: "post",
    data,
  });
}
// 批量新增
export function rowBatchCreate (data = []) {
  return request({
    url: `${mesUrl}mesWorkCalendars/batch`,
    method: "post",
    data,
  });
}
// 修改
export function rowUpdate (data = {}) {
  return request({
    url: `${mesUrl}mesWorkCalendars`,
    method: "put",
    data,
  });
}
// 删除
export function rowDel (id) {
  return request({
    url: `${mesUrl}mesWorkCalendars/${id}`,
    method: "put",
  });
}
// 删除
export function deleteByDate (data = {}) {
  return request({
    url: `${mesUrl}mesWorkCalendars/deleteByDate`,
    method: "post",
    data,
  });
}
// 详情
export function rowDetail (id) {
  return request({
    url: `${mesUrl}mesWorkCalendars/info/${id}`,
    method: "get",
  });
}
//班组下拉列表
export function lineCodeLA (id) {
  console.log(id);
  return request({
    url: `${mesUrl}mesTeam/list?lineCode=` + id,
    method: "get",
  });
}
//查询班次信息列表
export function mesShiftList (id) {
  return request({
    url: `${mesUrl}mesShift/list`,
    method: "get",
  });
}
// 工作日历-查询当日详情信息
export function mesWorkCalendarsList (params = {}) {
  return request({
    url: `${mesUrl}mesWorkCalendars/list`,
    method: "get",
    params,
  });
}
// 工作日历-主页信息
export function mainPageList (params = {}) {
  return request({
    url: `${mesUrl}mesWorkCalendars/mainPageList`,
    method: "get",
    params,
  });
}
// 工作日历-主页信息
export function copy (data = {}) {
  return request({
    url: `${mesUrl}mesWorkCalendars/copy`,
    method: "post",
    data,
  });
}
/// 工作日历-删除
export function deleteMapping (data) {
  return request({
    url: `${mesUrl}mesWorkCalendars/${data}`,
    method: "delete",
    data,
  });
}
